package com.chuxi.demo.cglib2;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @ Author:任留辉
 * @ Description:
 * @ Date:Created in 20:37 2021/7/23 0023
 */
public class MyMethodInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object sbj, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("你好啊，请计算吧");
        Object obje = methodProxy.invokeSuper(sbj, objects);
        System.out.println("你做的很好！");

        return obje;
    }
}
